# Maintainer: Sergej Pupykin <arch+pub@sergej.pp.ru>

pkgname=perl-params-validationcompiler
_pkgname=Params-ValidationCompiler
pkgver=0.31
pkgrel=1
pkgdesc="Build an optimized subroutine parameter validator once, use it forever"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-role-tiny' 'perl-eval-closure' 'perl-exception-class')
checkdepends=('perl-test-fatal')
url="https://search.cpan.org/dist/Params-ValidationCompiler/"
source=(https://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Params-ValidationCompiler-$pkgver.tar.gz)
sha256sums=('7b6497173f1b6adb29f5d51d8cf9ec36d2f1219412b4b2410e9d77a901e84a6d')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='"$pkgdir"'" \
    PERL_MB_OPT="--installdirs vendor --destdir '"$pkgdir"'" \
    MODULEBUILDRC=/dev/null

  cd "${srcdir}/${_pkgname}-${pkgver}"
  perl Makefile.PL
  make
}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  make install
}
